import http from '@/utils/http'

const BASE_URL = '/shop/fin-account'

export interface FinAccountResp {
  id: string
  name: string
  account: string
  remark: string
  status: number
}

export interface FinAccountDetailResp {
  id: string
  name: string
  account: string
  remark: string
  status: number
}

export interface FinAccountQuery extends SortQuery {
  name?: string
  account?: string
  status?: number
}

export interface FinAccountPageQuery extends FinAccountQuery, PageQuery {

}

/** @desc 查询班級類型列表 */
export function getList(query: FinAccountQuery) {
  return http.get<FinAccountResp[]>(`${BASE_URL}/list`, query)
}

/** @desc 查询班级类型详情 */
export function getDetail(id: string) {
  return http.get<FinAccountDetailResp>(`${BASE_URL}/detail/${id}`)
}

/** @desc 创建班级类型 */
export function create(data: any) {
  return http.post(`${BASE_URL}/create`, data)
}

/** @desc 修改班级类型 */
export function update(data: any, id: string) {
  return http.post(`${BASE_URL}/update/${id}`, data)
}

/** @desc 删除班级类型 */
export function remove(id: string) {
  return http.post(`${BASE_URL}/delete/${id}`)
}
